<!DOCTYPE html>
<html lang="en">

<head>
<title>登录页面</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="assets/css/bootstrap.min.css" />
<link rel="stylesheet" href="assets/css/bootstrap-responsive.min.css" />
<link rel="stylesheet" href="assets/css/matrix-login.css" />
<link
	href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,800'
	rel='stylesheet' type='text/css'>

</head>
<body>
	<div id="loginbox">
		<form id="loginform" class="form-vertical" >
			<div class="control-group normal_text">
				<h3>
					<img src="assets/img/logo.png" alt="Logo" />
				</h3>
			</div>
			<div class="control-group">
				<div class="controls">
					<div class="main_input_box">
						<span class="add-on bg_lg"><i class="icon-user"></i></span><input
							type="text" id="userName" name="userName" placeholder="用户名" />
					</div>
				</div>
			</div>
			<div class="control-group">
				<div class="controls">
					<div class="main_input_box">
						<span class="add-on bg_ly"><i class="icon-lock"></i></span><input
							type="password" id="password" name="password" placeholder="密码" />
					</div>
				</div>
			</div>
			<div class="form-actions">
				<span class="pull-left"> 
					<input class="flip-link btn btn-info" type="reset" value="重置" />
				</span>
				<span class="pull-right"> 
					<input type="button" id="login_bt" class="btn btn-success" value="登录">
			 	</span>
			</div>
		</form>
	</div>

	<script src="assets/js/jquery.min.js"></script>
	<script src="assets/js/jquery-1.8.3.min.js"></script>
	<script type="text/javascript" src="assets/js/jquery.form.js"></script>
	<script type="text/javascript" src="assets/js/layer/layer.js"></script>

	<script>
		$("#login_bt").click(function(){
			var userName = $("#userName").val();
			var password = $("#password").val();
			if($.trim(userName) == "" || $.trim(password) == ""){
				layer.msg("用户名和密码不能为空");
				return false;
			}
			
			$("#loginform").ajaxSubmit({//jquery.form.js
				url:"/moviesMaven/login2.htm",
				async:true,
				dataType:"json",
				success:function(data){
					if(data.success){//登录成功
						
						location.href = "/moviesMaven/html/movieshop.html"
					}else{
						layer.msg(data.message);
					}
				},
				error:function(XMLHttpRequest, textStatus, errorThrown) {
					layer.msg(textStatus+":"+XMLHttpRequest.status);
				}
			})
		})
	</script>
</body>

</html>
